//
//  FavoriteCell.m
//  ManStoreDemo
//
//  Created by qianfeng01 on 15/7/21.
//  Copyright (c) 2015年 xiangmu. All rights reserved.
//

#import "FavoriteCell.h"
#import "UIImageView+WebCache.h"
@implementation FavoriteCell

- (void)awakeFromNib {
    // Initialization code
}
-(void)showDataWithIndexPath:(NSIndexPath *)indexPath Array:(NSMutableArray *)arr Myblock:(FavoriteCellblock)myblock{
    self.indexPath=indexPath;
    self.arr=arr;
    self.myblock=myblock;
    
    DetaiModel *model=self.arr[indexPath.row];
    self.titleLabel.text=model.title;
    self.coupon_priceLabel.text=[NSString stringWithFormat:@"￥%@",model.coupon_price];

    
    NSString *url=[NSString stringWithFormat:@"%@",model.pic_url]; 
    [self.ImagerView sd_setImageWithURL:[NSURL URLWithString:url]];
}

- (IBAction)deleget:(UIButton *)sender {
    DetaiModel *model=self.arr[self.indexPath.row];
    [[DBManager sharedManager] deleteModelForNum_iid:model.num_iid];
    [self.arr removeObject:model];
    if (self.myblock) {
        self.myblock(self.arr);
    }
}



@end
